import type { AxiosRequestConfig, AxiosResponse } from 'axios'

// 不同的实例有可能有不同的拦截器
// 这里对应请求响应总共四个拦截器
export interface RTRequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (res: T) => T
  responseInterceptorCatch?: (error: any) => any
}

export interface RTRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: RTRequestInterceptors<T>
}
